﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using System.Windows;

namespace WpfAppXx
{
    public class ToolBarVM
    {
        public MainButtonVM[] ShapeInsertingButtons
        {
            get
            {
				//ButtonVM btnDot = new ButtonVM()
				//{
				//    ToolTipX = "Dot",
				//    ImageUri = ImageResources.Dot,
				//    CommandX = new DelegateCommand(() => DotClicked()),
				//    DefaultIndex = new IntClass() { IntValue = 2},
				//    SubButtonItems = new ButtonVM[]
				//    {
				//        new ButtonVM(){Caption = "Susinda", ImageUri = ImageResources.Ellipse},
				//        new ButtonVM(){Caption = "Asanka", ImageUri = ImageResources.Barcode},
				//        new ButtonVM(){Caption = "Sameera", ImageUri = ImageResources.Dot}
				//    }
				//};

				MainButtonVM btnLine = new MainButtonVM()
				{
                    SubButtonItems = new ButtonVM[]
					{
						new ButtonVM(){Caption = "Ellipse", ImageUri = ImageResources.Ellipse, ButtonAction = InsertingAction.Ellipse},
						new ButtonVM(){Caption = "Barcode", ImageUri = ImageResources.Barcode, ButtonAction = InsertingAction.Barcode}
					}
				};
				btnLine.CommandX = new DelegateCommand<InsertingAction>((InsertingAction insertingAction) => ButtonClicked(btnLine.ButtonAction));


				MainButtonVM btnCircle = new MainButtonVM()
				{
					ToolTipX = "Circle",
					ImageUri = ImageResources.Ellipse,
                    SubButtonItems = new ButtonVM[]
					{
						new ButtonVM(){Caption = "Barcode2", ImageUri = ImageResources.Barcode, ButtonAction = InsertingAction.Barcode},
						new ButtonVM(){Caption = "Eliipse2", ImageUri = ImageResources.Ellipse, ButtonAction = InsertingAction.Ellipse}
					}
				};
				btnCircle.CommandX = new DelegateCommand<InsertingAction>((InsertingAction insertingAction) => ButtonClicked(btnCircle.ButtonAction));


				MainButtonVM btnElipse = new MainButtonVM()
				{
					CommandX = new RoutedUICommand(),
                    SubButtonItems = new ButtonVM[]
					{
						new ButtonVM(){Caption = "Barcode", ImageUri = ImageResources.Barcode, ButtonAction = InsertingAction.Barcode},
					}
				};
				btnElipse.CommandX = new DelegateCommand<InsertingAction>((InsertingAction insertingAction) => ButtonClicked(btnElipse.ButtonAction));


                return new MainButtonVM[]{
										//btnDot,
										btnLine,
                                        btnElipse,
										btnCircle,
									  };
            }
        }

		private void ButtonClicked(InsertingAction action)
		{
			MessageBox.Show(action.ToString() + " Clicked ");
		}
    }
}
